<template>
    <div>
        <el-container direction="vertical" class="home_container">
            <homeheader></homeheader>
            <el-container>
                <homeaside></homeaside>
                <el-main>
                    <homebreadcrumb></homebreadcrumb>
                    <router-view></router-view>
                </el-main>
            </el-container>
            <homefooter></homefooter>
        </el-container>
    </div>
</template>

<script>
import homeheader from '@/components/home/homeHeader'
import homefooter from '@/components/home/homeFooter'
import homeaside from '@/components/home/homeAside'
import homebreadcrumb from '@/components/home/homeBreadcrumb'
export default({
    data(){
        return{
            
        }
    },
    components:{
        homeheader,
        homefooter,
        homeaside,
        homebreadcrumb
    },
    created(){
        if (sessionStorage.getItem('loginusername')){
            this.$store.commit('rememberLoginUser',sessionStorage.getItem('loginusername'))
        };
        if(this.$route.path != '/welcome'){
            this.$store.commit('keeppath',[sessionStorage.getItem('headerTitle'),sessionStorage.getItem('headerChildTitle')]);
        };
        window.addEventListener('beforeunload',()=>{
            if(this.$route.path != '/login'){
                sessionStorage.setItem('loginusername',this.$store.state.loginusername);
            }
            if(this.$route.path != '/welcome' && this.$route.path != '/login'){
                sessionStorage.setItem('headerTitle',this.$store.state.headerTitle);
                sessionStorage.setItem('headerChildTitle',this.$store.state.headerChildTitle);
            }            
        });


    }
})
</script>

<style lang="less"scoped>
  .home_container{
      height: 100vh;  
      .el-main {
          width: 100vw;
          background-color: #E9EEF3;
          padding: 0;
      }
  }
</style>